import json


class AppletInfo(object):
    applet_id: int
    applet_image_url: str
    applet_name: str
    group_name: str
    create_time: str
    expired_time: str
    setting_url:str
    manage_url:str

    def __init__(self, applet_id, applet_image_url, applet_name, group_name, create_time, expired_time,setting_url,manage_url):
        self.applet_id = applet_id
        self.applet_image_url = applet_image_url
        self.applet_name = applet_name
        self.group_name = group_name
        self.create_time = create_time
        self.expired_time = expired_time
        self.setting_url=setting_url
        self.manage_url=manage_url

    def to_dict(self):
        return {
            "applet_id": self.applet_id,
            "applet_image_url": self.applet_image_url,
            "applet_name": self.applet_name,
            "group_name": self.group_name,
            "create_time": self.create_time,
            "expired_time": self.expired_time,
            'setting_url': self.setting_url,
            'manage_url': self.manage_url
        }

    def to_json(self):
        return json.dumps(self.to_dict(), indent=4, ensure_ascii=False)

